--hook 克雷的sg 达到某种效果

--重定向动作的目标函数
local sghackerlist = {
    {
        state = "wilson_client",
        name = "run",
        hookfndata = {
            onenter = function(oldonenter)
                return function(inst, data)
                    oldonenter(inst, data)
                    --[[ if not inst.AnimState:IsCurrentAnimation(anim) then
                        inst.AnimState:PlayAnimation(anim, true)
                    end ]]
                end
            end,
            --[[   self.onenter = args.onenter
        self.onexit = args.onexit
        self.onupdate = args.onupdate
        self.ontimeout = args.ontimeout ]]
        }

    }
}
local remaplist = {}
for k, v in pairs(sghackerlist) do
    remaplist[v.state] = remaplist[v.state] or {}
    remaplist[v.state][v.name] = v
end
for state, v in pairs(remaplist) do
    AddStategraphPostInit(state, function(self)
        for name, data in pairs(v) do
            if data.tags then
                for _, tag in ipairs(data.tags) do
                    self.states[name].tags[tag] = true
                end
            end
            if data.hookfndata then
                for index, hookfn in pairs(data.hookfndata) do
                    local old = self.states[name][index]
                    self.states[name][index] = hookfn(old)
                end
            end
        end
    end)
end
